package service

import (
	"context"

	model "gitee.com/hust-ideas/little-genius-backend/model"
)

func (s *ServiceContext) UserProfileGet(req model.UserProfileGetReq, c context.Context) (resp *model.UserProfileGetResp, err error) {
	resp = &model.UserProfileGetResp{}
	// 获取用户信息
	u, err := s.Model.UserModel.FindOne(c, req.Uid)
	if err != nil {
		return nil, err
	}
	resp.UserInfo = &model.UserInfo{}
	resp.UserInfo.Id = uint64(u.ID)
	resp.UserInfo.Email = u.UEmail
	resp.UserInfo.Username = u.UName
	return
}
